#! /usr/bin/env python
# encoding: utf-8

VERSION = '0.0.1'
VERSION_MAJOR_MINOR = '.'.join(VERSION.split('.')[0:2])
APPNAME = 'libmshare'

top = '.' 
out = 'build' 

def options(opt):
	opt.tool_options('compiler_cc')
	opt.tool_options('gnu_dirs')

def configure(conf): 
	conf.check_tool('compiler_cc gnu_dirs')

	conf.load('vala', funs='')
	conf.check_vala(min_version=(0,10,0))
	conf.check_vala_deps()

	conf.check_cfg(package='gee-1.0', uselib_store='GEE', 
	     mandatory=True, args='--cflags --libs')

	conf.check_cfg(package='libsoup-2.4', uselib_store="LIBSOUP", mandatory=True,
		args='--cflags --libs' )

	conf.check_cfg(package='avahi-glib', uselib_store="AVAHI", mandatory=False,
		args=['avahi-client >= 0.5', 'avahi-glib >= 0.5', '--cflags', '--libs'] )

	conf.check(header_name='dns_sd.h', uselib_store='HAS_DNS_SD', mandatory=False)

	conf.define('PACKAGE', APPNAME)
	conf.define('PACKAGE_NAME', APPNAME)
	conf.define('PACKAGE_STRING', APPNAME)
	conf.define('PACKAGE_VERSION', APPNAME)

	conf.define('VERSION', APPNAME)
	conf.define('VERSION_MAJOR_MINOR', VERSION_MAJOR_MINOR)

def build(build):
	build.add_subdirs('libmshare')
	#build.add_subdirs('src')